﻿using FluentValidation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IdentityServer.Infrastructure.Validators
{
    public record RegisterUserByEmailAndPwdRequest(string UserName,string Email,string Code,string Password1,string Password2);
    public class RegisterUserByEmailAndPwdRequestValidator : AbstractValidator<RegisterUserByEmailAndPwdRequest>
    {
        public RegisterUserByEmailAndPwdRequestValidator()
        {
            RuleFor(x => x.UserName).NotEmpty().NotNull();
            RuleFor(x => x.Email).NotEmpty().NotNull();
            RuleFor(x=>x.Code).NotEmpty().NotNull();
            RuleFor(x => x.Password1).NotNull().NotEmpty().Equal(x=>x.Password2);
        }
    }
}
